package org.hugoduncan.appam.server;

import java.io.IOException;

import javax.servlet.ServletException;

/**
 * A Handler responsable for requests dispatched to a path that
 * matches a pattern.  Similar to a ServletMapping, but maps within a
 * single servlet.  Paths are expected to be prefix paths, and the set
 * of paths is non-overlapping.
 *
 * @author duncanhugo
 *
 */
public interface PathHandler
{
    /**
     * Process a request.
     * @param request
     * @param response
     * @return true if response has been handled
     * @throws IOException
     * @throws ServletException
     */
    boolean process(AppServletRequest request, AppServletResponse response)
        throws IOException, ServletException;
}
